# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

_pkgname=sqlite-jdbc
pkgname=java-$_pkgname
pkgver=3.27.2.1
pkgrel=1
pkgdesc='Java SQLite database connector'
arch=('loong64' 'x86_64')
url='https://github.com/xerial/sqlite-jdbc'
license=('Apache')
depends=('java-runtime' 'sqlite')
makedepends=('maven')
source=("$_pkgname-$pkgver::$url/archive/$pkgver.tar.gz")
sha512sums=('78fa3ac06ecf376a89e385469b4c1781a639a6757d8d63519e8441a1cf5de9d5bd0abad5e7c725a365cf6acfe1e62d68fadb8901a62fe2d6b4aa8f04814f2cd0')

build() {
  cd $_pkgname-$pkgver

  mvn package -DskipTests
}

check() {
  cd $_pkgname-$pkgver

  mvn verify
}

package() {
  cd $_pkgname-$pkgver/target

  install -Dm 644 $_pkgname-$pkgver.jar "$pkgdir"/usr/share/java/$_pkgname/$_pkgname-$pkgver.jar
  ln -sf /usr/share/java/$_pkgname/$_pkgname-$pkgver.jar "$pkgdir"/usr/share/java/$_pkgname/$_pkgname.jar
}

